package com.fenghongzhang.day002;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.internal.platform.Platform;

public class MyIntercepter implements Interceptor {

    @Override
    public Response intercept(Chain chain) throws IOException {

        //后端生成,返回给你的
        Request token =  chain.request().newBuilder().addHeader("token", "123123123").build();
        Platform.get().log(Platform.INFO,"添加了一个头",null);
        return chain.proceed(token);
    }
}
